<div class="container">
    <div class="col-sm-12">
        <p align="center">
        <h3 class='index_tilte'><p class="text-center">当前座位使用情况</p></h3>
        <div>
            <table class="table table-bordered ">
                <tr class="th">
                    <td widtd="12">座位号</td>
                    <td widtd="10%">姓名</td>
                    <td widtd="63%">项目</td>
                    <td widtd="15%">到期时间</td>
                </tr>
                <?php
                for ($i = 1; $i <= 12; $i++):
                    $flag = 0;
                    $record = select_record_site();
                    foreach ($record as $key => $value) {
                        if ($value[0] == $i) {
                            $flag = 1;
                            $loca = $key;
                            break;
                        }
                    }
                    ?>
                    <?php if ($flag == 1): ?>
                        <tr>
                            <td><?php echo htmlspecialchars($record[$loca]['site']); ?></td>
                            <td><?php echo htmlspecialchars($record[$loca]['name']); ?></td>
                            <td><?php echo htmlspecialchars($record[$loca]['activity']); ?></td>
                            <td><?php echo htmlspecialchars($record[$loca]['time_to']); ?></td>
                        </tr>
                    <?php endif; ?>
                    <?php if ($flag == 0): ?>
                        <tr>
                            <td><?php echo $i; ?></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                    <?php endif; ?>
                <?php endfor; ?>
            </table>
        </div>
    </div>
</div>
